{% extends "default.html" %}
{% block body_class %}post-template tag-fables{% endblock %}
{% block header %}
<link rel="stylesheet" type="text/css" href="{{ 'css/pygments.css'|asset }}" />
{% endblock %}

{% block body %}

{% set image = post.image %}
{% include 'header.html' %}
<main class="content" role="main">
    <article class="post {{post_class}}">
        <header class="post-header">
            <h1 class="post-title">{{ post.title }}</h1>
            <section class="post-meta">
                <time class="post-date" datetime="{{ post.date|strftime('%Y-%m-%d') }}">{{ post.date|strftime('%d %b %Y') }}</time>
                {% if post.tags %}
                    {{ ' on '}}
                    {% for tag in post.tags %}
                    <a href="{{ tag.url }}"> {{ tag.title }} </a>
                    {% endfor %}
                {% endif %}
            </section>
        </header>
        <section class="post-content">
            {{ post.content }}
        </section>
        <footer class="post-footer">
        {% if author.avator %}
        <figure class="author-image">
            <a class="img" href="{{ author.url }}" style="background-image: url({{ author.avator }})"><span class="hidden">{{ author.name }}'s Picture</span></a>
        </figure>
        {% endif %}
        <section class="author">
            <h4><a href="{{ author.url }}">{{ author.name }}</a></h4>
            {% if author.bio %}
                <p>{{ author.bio }}</p>
            {% endif %}
            <div class="author-meta">
                {% if author.location%}
                <span class="author-location"><i class="fa fa-map-marker"></i>{{ author.location }}</span>
                {% endif %}
                {% if author.url %}
                <span class="author-link"><a href="{{ author.url }}"><i class="fa fa-link"></i>{{ author.url }}</a></span>
                {% endif %}
            </div>
        </section>
            <section class="share">
                <h4>Share this post</h4>
                <a href="https://twitter.com/intent/tweet?text={{ post.title|e }}&amp;url={{ post.url|abs_url }}"
                    onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
                    <i class="fa fa-twitter"></i>
                    <span class="hidden">Twitter</span>
                </a>
                <a href="https://www.facebook.com/sharer/sharer.php?u={{ post.url|abs_url }}"
                    onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;">
                    <i class="fa fa-facebook-square"></i>
                    <span class="hidden">Facebook</span>
                </a>
                <a class="icon-google-plus" href="https://plus.google.com/share?url={{ post.url|abs_url }}"
                   onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;">
                    <i class="fa fa-google-plus-square"></i>
                    <span class="hidden">Google+</span>
                </a>
            </section>
        </footer>
        {% if site.get('disqus') %}
            {% include 'disqus.html' %}
        {% endif %}
    </article>
</main>
<aside class="read-next">
    {% if next_post %}
    <a class="read-next-story {% if next_post.image %}" style="background-image: url({{ next_post.image }}){% else %}no-cover{% endif %}" href="{{ next_post.url }}">
        <section class="post">
            <h2>{{ next_post.title }}</h2>
			<p>{% if next_post.excerpt %}{{ next_post.excerpt }}{% endif %}&hellip;</p>
        </section>
    </a>
    {% endif %}
    {% if prev_post %}
    <a class="read-next-story prev {% if prev_post.image %}" style="background-image: url({{ prev_post.image }}){% else %}no-cover{% endif %}" href="{{ prev_post.url }}">
        <section class="post">
            <h2>{{ prev_post.title }}</h2>
			<p>{% if prev_post.excerpt %}{{ prev_post.excerpt }}{% endif %}&hellip;</p>
        </section>
    </a>
    {% endif %}
</aside>
{% endblock %}
